package com.ss.android.http.legacy.a;

import com.bytedance.frameworks.baselib.network.http.util.b;
import com.ss.android.http.legacy.NameValue;

public final class NameValueImpl implements NameValue, Cloneable {
    public final String name;
    public final String value;

    public NameValueImpl(String name, String value) {
        if(name == null) {
            throw new IllegalArgumentException("Name may not be null");
        }
        this.name = name;
        this.value = value;
    }

    public final String name() {
        return this.name;
    }

    public final String value() {
        return this.value;
    }

    public final Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    public final boolean equals(Object obj) {
        boolean v0 = false;
        if(obj != null) {
            if(this == (((NameValueImpl)obj))) {
                v0 = true;
            }
            else if(((obj instanceof NameValue)) && (this.name.equals(((NameValueImpl)obj).name)) && (android.support.design.a.a((Object) this.value, (Object) ((NameValueImpl)obj).value))) {
                v0 = true;
            }
        }

        return v0;
    }

    public final int hashCode() {
        return android.support.design.a.a(android.support.design.a.a(17, (Object) this.name), (Object) this.value);
    }

    public final String toString() {
        int v0 = this.name.length();
        if(this.value != null) {
            v0 += this.value.length() + 1;
        }

        b v1 = new b(v0);
        v1.a(this.name);
        if(this.value != null) {
            v1.a("=");
            v1.a(this.value);
        }

        return v1.toString();
    }
}

